package com.digua.base.base

import androidx.viewpager2.widget.ViewPager2

open class BaseOnPageChangeCallback : ViewPager2.OnPageChangeCallback {
    private var lambda: ((position: Int) -> Unit)? = null

    constructor(lambda: ((position: Int) -> Unit)? = null) {
        this.lambda = lambda
    }

    override fun onPageSelected(position: Int) {
        super.onPageSelected(position)
        lambda?.let { it(position) }
    }
}